﻿Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Data.Linq

Public Class DL
    Private objDataContext As LinqDataContext
    Public Sub New(ByVal conStr As String)
        objDataContext = New LinqDataContext(conStr)

    End Sub

    Public Function InsertRecord(ByVal localTable As T01) As String
        Try
            objDataContext.T01.InsertOnSubmit(localTable)
            objDataContext.SubmitChanges()
            Return localTable.id
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function SelectAllPoint() As List(Of T01)
        Try

            Dim q = From e In objDataContext.T01 Order By e.id Select e
            'Return objDataContext.MV_TEMPLATE_ITEM
            Return q.ToList
        Catch ex As Exception
            Throw ex

        End Try


    End Function

End Class
